Current Location: Home> Function Categories> log1p

log1p

Returns log(1 + number), and can calculate the exact result even when the value of number is close to zero.
Name:log1p
Category:math
Programming Language:php
One-line Description:Returns log(1+number).

Definition and usage

log1p() returns log(1+ number ) , and the accurate result can be calculated even when the value of number is close to zero.

Example

Returns the log(1+ number ) of different values. Calculation result:

 <?php
echo ( log1p ( 2.7183 ) ) ;
echo ( log1p ( 2 ) ) ;
echo ( log1p ( 1 ) ) ;
echo ( log1p ( 0 ) ) ;
?>

Try it yourself

grammar

 log1p ( x )
parameter describe
x Required. A number.

illustrate

Warning: This function is experimental. The behavior of this function, including function name and any other documentation about this function, may change with subsequent releases by PHP without notification. Use of this function at your own risk.

Similar Functions
  • Generate better random numbers mt_rand

    mt_rand

    Generatebetterrandom
  • Antihyperbolic cosine acosh

    acosh

    Antihyperboliccosine
  • Hyperbolic sine sinh

    sinh

    Hyperbolicsine
  • Absolute value abs

    abs

    Absolutevalue
  • Determine whether it is a legal value is_nan

    is_nan

    Determinewhetheritis
  • Further method to sort ceil

    ceil

    Furthermethodtosort
  • Convert decimal to hexadecimal dechex

    dechex

    Convertdecimaltohexa
  • Convert hexadecimal to decimal hexdec

    hexdec

    Converthexadecimalto
Popular Articles